libbpf: link shared object with libelf
authorHilko Bengen <bengen@debian.org>
Sun, 2 Dec 2018 23:26:03 +0000 (23:26 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 15 Mar 2019 02:16:04 +0000 (02:16 +0000)
libbpf.so needs to be linked against libelf to avoid missing symbols.

Signed-off-by: Hilko Bengen <bengen@debian.org>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name libbpf-link-shared-object-with-libelf.patch

tools/lib/bpf/Makefile

index db845fd585b1ae5662f756279e3f1c66b3f870d6..b65761b8e79cfeeb319438b025003edf977f6ca1 100644 (file)
@@ -161,7 +161,7 @@ $(BPF_IN): force elfdep bpfdep
        $(Q)$(MAKE) $(build)=libbpf
 
 $(OUTPUT)libbpf.so.$(LIBBPF_VERSION): $(BPF_IN)
-       $(QUIET_LINK)$(CC) --shared $^ -Wl,-soname,$(@F) -o $@
+       $(QUIET_LINK)$(CC) --shared $^ -lelf -Wl,-soname,$(@F) -o $@
 
 $(OUTPUT)libbpf.a: $(BPF_IN)
        $(QUIET_LINK)$(RM) $@; $(AR) rcs $@ $^